package com.sf.web.controller;

import com.sf.qo.QueryObject;
import com.sf.service.ICarService;
import com.sf.util.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class CarController {

    @Autowired
    private ICarService carService;

    /**
     * /departmnet/list 请求
     * currentPage  当前页
     */
    @RequestMapping("/car/list")
    public String list(QueryObject queryObject, Model model){
        PageResult result = carService.query(queryObject);

        // 把数据放到model 中
        model.addAttribute("pageResult",result);
        // 跳转界面
        return "car/list";
    }

}
